﻿using System;
using System.Windows.Forms;
using ESRI.ArcGIS.Controls;

namespace Swsk33.SimpleArcEngine.Dialog
{
	public partial class ManageDialog : Form
	{
		private AxMapControl currentMapControl;

		public ManageDialog(AxMapControl mapControl)
		{
			currentMapControl = mapControl;
			InitializeComponent();
		}

		private void cancel_Click(object sender, EventArgs e)
		{
			Close();
		}

		private void delete_Click(object sender, EventArgs e)
		{
			if (layerNames.SelectedIndex < 0)
			{
				MessageBox.Show("请选择一个图层删除！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
				return;
			}
			else
			{
				currentMapControl.DeleteLayer(layerNames.SelectedIndex);
				layerNames.Items.RemoveAt(layerNames.SelectedIndex);
			}
		}
	}
}